package middleware

import (
	"net/http"

	"go-gin-api/internal/pkg/core"
	"go-gin-api/pkg/errno"
)

func (m *middleware) RBAC() core.HandlerFunc {
	return func(c core.Context) {
		token := c.GetHeader("Token")
		if token == "" {
			c.AbortWithError(errno.NewError(
				http.StatusUnauthorized,
				"Header 中缺少 Token 参数"),
			)
			return
		}

	}
}
